<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <h2>断网提醒测试</h2>
</body>
<script>
  const { dialog } = require('electron').remote
  /*
  * online 网络连接时候
  */
  window.addEventListener('online', () => {
    dialog.showMessageBox({
      title: '提示',
      message: '已连接网络'
    })
  })
  window.addEventListener('offline', () => {
    dialog.showMessageBox({
      title: '提示',
      message: '已断网'
    })
  })
</script>
</html>